using System;
using System.Collections.Generic;
using System.Text;
using DataAccessObject;
using DataTransferObject;
namespace BusinessLogicLayer
{
    public class BoDeBLL
    {
        private string _conn;
        public BoDeBLL()
        {
            Common g = new Common();
            _conn = g.conn;
        }

        public int ThemBoDe(clsBoDe BoDe)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.ThemBoDe(BoDe);
        }

        public void SuaBoDe(clsBoDe BoDe)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            bodeDAO.CapNhatBoDe(BoDe);
        }
        public int XoaBoDe(int MaBoDe)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.XoaBoDe(MaBoDe);
        }

        public List<clsBoDe> DanhSachBoDe()
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.LayTatCaDanhSachBoDe();
        }

        public clsBoDe LayBoDeTheoId(int mabode)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.LayBoDeTheoId(mabode);
        }
        public List<clsCauHoi> LayDanhSachCauHoiKhongThuocBoDe(int MaBoDe)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.DanhSachCauHoiKhongThuocBoDe(MaBoDe);
        }
        public List<clsCauHoi> LayDanhSachCauHoiThuocBoDe(int MaBoDe,int flag)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            return bodeDAO.DanhSachCauHoiThuocBoDe(MaBoDe,flag);
        }

        public void CapNhatSoCauHoi_ThoiGian(int socauhoi, int thoigian, int mabode)
        {
            BoDeDAO bodeDAO = new BoDeDAO(this._conn);
            bodeDAO.CapNhatSoCauHoi_ThoiGian(socauhoi, thoigian, mabode);
        }

        public int MaDeHienTai()
        {
            BoDeDAO bodeDAO = new BoDeDAO(_conn);
            return bodeDAO.MaBoDe();
        }
    }
}
